{include file='header.html'}
 <div class="table"> 
      <div class="row">
          <span class="td4 h1top">
          <div class="botline"></div>
          <div class="filtrs"> Фильтр
             <form method="post" action="{geturl action='myrequests'}" id="filter-form">
       
            <select name='cats_filter[]' id='cats_filter' data-placeholder="Выбрать категорию" class="chosen-select_cat" multiple style="width:170px;" tabindex="4">
                <option value="0" ></option>
                {foreach from=$cats item=cat}
                {if in_array($cat->getId(),$cats_filter)}
                <option value="{$cat->getId()}" selected='selected'>{$cat->name}</option>
                {else}
                <option value="{$cat->getId()}">{$cat->name}</option>
                {/if}
                {/foreach}
            </select>
         
            <select name='projects_filter[]' id='projects_filter' data-placeholder="Выбрать проект" class="chosen-select_project" multiple style="width:170px;" tabindex="4">
                <option value='0'></option>
                {foreach from=$projects item=project}
                {if in_array($project->getId(), $projects_filter)}
                <option value="{$project->getId()}" selected='selected'>{$project->name}</option>
                {else}
                <option value="{$project->getId()}">{$project->name}</option>
                {/if}
                {/foreach}
            </select>
         
                   
            <select name='archive_filter' id='projects_filter' data-placeholder="Показывать все" class="chosen-select_project" style="width:150px;" tabindex="4">
                {if $archive_filter == ''}
                <option value="2" selected='selected'>Все</option>
                {else}
                <option value="2">Все</option>
                {/if}

                {if $archive_filter == 0}
                <option value="0" selected='selected'>На рассмотрении</option>
                {else}
                <option value="0">На рассмотрении</option>
                {/if}

                {if $archive_filter == 1}
                <option value="1" selected='selected'>Принятые</option>
                {else}
                <option value="1">принятые</option>
                {/if}

            </select>   
          <button type="submit" class="send">Фильтр</button>
             
       
    </form>
        </div>
        <div class="botline"></div>
 {if $requests|@count>0}       <table class="tdzayavki">
          <thead>
            <tr> 
              <td class="tb1">
                  {if $sort=='u.manager'}
                    <a href="?sort=u.manager&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}"> Контактное лицо</a>
                    {else}
                    <a href="?sort=u.manager&order={if $order=='desc'}asc{else}desc{/if}"> Контактное лицо</a>
                    {/if}
              </td>
              <td class="tb2">
               {if $sort=='u.company'}
            <a href="?sort=u.company&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Предприятие</a>
            {else}
            <a href="?sort=u.company&order={if $order=='desc'}asc{else}desc{/if}">Предприятие</a>
            {/if}
              </td>
              <td class="tb3">
               {if $sort=='t.name'}
            <a href="?sort=t.name&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Тендер</a>
            {else}
            <a href="?sort=t.name&order={if $order=='desc'}asc{else}desc{/if}">Тендер</a>
            {/if}
              </td>
              <td class="tb3">
              {if $sort=='c.dtime'}
            <a href="?sort=c.dtime&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}"> Дата подачи</a>
            {else}
            <a href="?sort=c.dtime&order={if $order=='desc'}asc{else}desc{/if}"> Дата подачи</a>
            {/if}
              </td>
              <td class="tb4">
                 {if $sort=='c.isApproved'}
            <a href="?sort=c.isApproved&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Статус</a>
            {else}
            <a href="?sort=c.isApproved&order={if $order=='desc'}asc{else}desc{/if}">Статус</a>
            {/if}
              </td>
              <td class="tb5">Действие</td>
            </tr>
          </thead>
{foreach from=$requests item=request}
    <tr>
        <td class="nocontainer fs12">{$request->user->manager}</td>
        <td>{$request->user->company}</td>
        <td class="nocontainer">{$request->tender->name}</td>
        <td>{$request->dtime|date_format:"%d.%m.%Y"}</td>
        <td>
           {if $request->winner->idTender}
           
            <img src="/images/winner-cup.png" alt="Победитель" title="Победитель">
            {else}
            {if $request->isApproved == 1}
            <img src="/images/index-08.png" alt="" class="noborders">
            {elseif $request->isDeleted == 1}
            <img src="/images/index-07.png" alt="" class="noborders">
            {else}
            <img src="/images/index-09.png" alt="" class="noborders">
            {/if}
            {/if}
        </td>
           <td>    {if !$request->isApproved} <a href="{geturl route='requestedit' id=$request->getId()}">Редактировать заявку</a>{/if}
            <a href="{geturl route='request' id=$request->getId()}">Просмотреть заявку</a></td>
      
    </tr>
    {/foreach}    
        </table>
       

{else}
<h3>По вашему запросу заявок не найдено</h3>
{/if}
                <div class="botline"></div>
          </span> 
<span class="td5 linedt5">
<div class="botline mgbkmen"></div>
<a href="{geturl action='index'}" {if $usermenu=='index'}class="blockmenuact"{else}class="blockmenu"{/if}>Главная личного кабинета</a>
<a href="{geturl action='editprofile'}" {if $usermenu=='editprofile'}class="blockmenuact"{else}class="blockmenu"{/if}>Редактировать данные профиля</a>
<a href="{geturl action='myrequests'}" {if $usermenu=='myrequests'}class="blockmenuact"{else}class="blockmenu"{/if}>Мои заявки</a>

<a href="{geturl action='index' controller='index'}" class="blockmenu" >Вернуться на сайт</a>
</span>
            
     
      </div>
     </div>
{include file='footer.html' menu="requests"}
